#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_CHILDREN 10

extern int yylineno;
extern char* yytext;
extern void yyrestart(FILE *input_file);
extern int yyparse (void);

typedef struct TreeNode {
	char *name;
	int line;

	char* type_val;
	int int_val;
	float float_val;
	int type; //float 0; int 1; type or str: 2; non_null_syntax_node: 3; null_syntax_node: 4; terminal:5

   	struct TreeNode * children[MAX_CHILDREN];
	int children_num;
} TreeNode;

TreeNode* root;
int my_is_error;

void yyerror(char* msg);
char *generate_blank(int level);
void root_first(TreeNode *root, int level);
TreeNode* new_node_float(char* name, float float_val);
TreeNode* new_node_int(char* name, int int_val);
TreeNode* new_node_str(char* name, char* type_val);
TreeNode* new_node_syntax(char* name, int line);
TreeNode* new_node_null();
TreeNode* new_node_terminal(char* name);
TreeNode* new_node(TreeNode* parent, TreeNode* children[MAX_CHILDREN], int num);




